package club.justwill.single.persistence.jpo;

import club.justwill.single.persistence.support.HistoryJpo;
import club.justwill.single.persistence.support.ProjectIntroduceBase;

import javax.persistence.*;

/**
 * Created by luoyu on 15-12-24.
 */
@Entity
@Table(name = "project_introduce_history")
public class ProjectIntroduceHistory extends ProjectIntroduceBase implements HistoryJpo<ProjectIntroduce> {

    @Column(name = "project_introduce_id")
    private long projectIntroduceId;

    @Id
    @Column(name = "sequence")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long sequence;

    public Long getSequence() {
        return sequence;
    }

    public void setSequence(Long sequence) {
        this.sequence = sequence;
    }

    @Override
    public void copy(ProjectIntroduce obj) {
        super.copyBase(obj);
    }

    public long getProjectIntroduceId() {
        return projectIntroduceId;
    }

    public void setProjectIntroduceId(Long projectIntroduceId) {
        if(projectIntroduceId == null) {
            this.projectIntroduceId = 0L;
        } else {
            this.projectIntroduceId = projectIntroduceId;
        }
    }
}
